/*
 * PurchaseDetails.fx
 *
 * Created on 2009-7-29, 19:35:59
 */

package com.sjtu.fx.admin;

import javafx.scene.*;
import com.sjtu.fx.tools.Panel;
import javafx.scene.control.Label;

import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;


import com.sjtu.fx.tools.SwingTextArea;
import javafx.scene.control.Button;

public class PurchaseDetails extends CustomNode{
     var panel:Panel;
     public var bookName:String = bind bookName with inverse;
     public var userName:String = bind userName with inverse;
     public var requestDate:String = bind requestDate with inverse;
     public var comment:String = bind comment with inverse;
     public var score:Integer = bind score with inverse;
     public var isbn:String = bind isbn with inverse;
     public var author:String = bind author with inverse;
     public var publisher:String = bind publisher with inverse;

     var bnameLabel = Label {
             text: "Book Name :"
             font: Font {size:12 name: "Verdana"}
             textFill: Color.rgb(11,51,60)
         }
     var bnameInform = Label {
             text: bind bookName
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }
      var unameLabel = Label {
             text: "User Name :"
             font: Font {size:12 name: "Verdana"}
             textFill: Color.rgb(11,51,60)
         }
     var unameInform = Label {
             text: bind userName
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }

     var dateLabel = Label {
             text: "Request Date :"
             font: Font {size:12 name: "Verdana"}
             textFill: Color.rgb(11,51,60)
         }
     var dateInform = Label {
             text: bind requestDate
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }

     var isbnLabel = Label {
             text: "Book ISBN :"
             font: Font {size:12 name: "Verdana"}
             textFill: Color.rgb(11,51,60)
         }
     var isbnInform = Label {
             text: bind isbn
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }
     var authorLabel = Label {
             text: "Book Author :"
             font: Font {size:12 name: "Verdana"}
             textFill: Color.rgb(11,51,60)
         }
     var authorInform = Label {
             text: bind author
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }

     var publishLabel = Label {
             text: "Book Publisher :"
             font: Font {size:12 name: "Verdana"}
             textFill: Color.rgb(11,51,60)
         }
     var publishInform = Label {
             text: bind publisher
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }
     var scoreLabel = Label {
             text: "Score :"
             font: Font {size:12 name: "Verdana"}
             textFill: Color.rgb(11,51,60)
         }
     var scoreInform = Label {
             text: bind score.toString()
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }

     var commentInform = Label {
             text: "Comment on Book:"
             font: Font {size:12 name: "Verdana" }
             textFill: Color.rgb(11,51,60)
         }
    var commentArea = SwingTextArea{
        text: bind comment
        columns:20
        rows:6
        editable:false
    }

     var ok = Button {
             translateX:200 translateY:480
             text: "OK"
             action: function() {
                 visible = false;
             }
         }

     override protected function create() : Node{
          Group{
            content:[
                panel = Panel {
                    width:    430
                    height:   550
                    title:    "Purchase Request Details"
                    translateX: 0
                    translateY: 0
                },
                VBox{
                    spacing:25
                    translateX:25 translateY:50
                    content:[
                            dateLabel,
                            bnameLabel,
                            unameLabel,
                            isbnLabel,
                            authorLabel,
                            publishLabel,
                            scoreLabel,
                            commentInform,

                        ]
                },
                 VBox{
                    spacing:25
                    translateX:180 translateY:50
                    content:[
                            dateInform,
                            bnameInform,
                            unameInform,
                            isbnInform,
                            authorInform,
                            publishInform,
                            scoreInform,
                            commentArea,
                        ]
                },ok

                ]
          }
     }

}
